#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>
#include <assert.h>

void* my_memmove(void* dest, void* src, size_t num)
{
	assert(dest && src);
	if (dest < src)
	{
		while (num--)
		{
			*((char*)dest)++ = *((char*)src)++;
		}
	}
	else
	{
		*((char*)dest + num) = *((char*)src + num);
	}
}

int main()
{
	int arr[] = { 1,2,3,4,5,6,7,8,9,10 };
	my_memmove(arr, arr + 2, 5 * sizeof(int));
	int i = 0;
	for (i = 0; i < sizeof(arr) / sizeof(arr[0]); i++)
	{
		printf("%d ", arr[i]);
	}
	return 0;
}